### --- Test setup ---
if(FALSE) {
	## Not really needed, but can be handy when writing tests
	library("RUnit")
	library("unsupervisedMicroarray")
}

#data for tests
library(rda)
data(brain)
data(iris)
irDat <- as.matrix(iris[,-5])
irC <- as.numeric(iris[,5])
irCO <-as.numeric(iris[,5]);irCO[1]<-4

bx <- brain.x[,70:100]
by <- brain.y
byO <-by; byO[1]<-6
mm<-(matrix(runif(100),ncol=5))
mmC <- c(rep(1,10),rep(2,10))
mmCO <- c(rep(1,10),rep(2,10));mmCO[1] <-3

scoreF <-function(scoreObj,inputSet,clusters){
	indexx <- ScoreSet(scoreObj,inputSet,clusters)
	
	checkTrue(is.numeric(indexx))
	checkTrue(indexx >=-1)
	checkTrue(indexx <=1)
	print("INDEX: ");print(indexx)
}

scoreS <-function(scoreObj,inputSet,clusters){
	indexx <- ScoreSet(scoreObj,inputSet,clusters)
	
	checkTrue(is.numeric(indexx))
	
	#checkTrue(indexx <=1)
	print("INDEX: ");print(indexx)
}


test.fakeClusters_RAND <- function(){
	indO <- new("HARandEClusterScore")
	
	scoreF(indO,list(X=irDat,Y=irC),irC)
	scoreF(indO,list(X=irDat,Y=irC),irCO)
	scoreF(indO,list(X=bx,Y=by),by)
	scoreF(indO,list(X=bx,Y=by),byO)
	scoreF(indO,list(X=mm,Y=mmC),mmC)
	scoreF(indO,list(X=mm,Y=mmC),mmCO)
	
}


test.fakeClusters_Silh <- function(){
	indO <- new("SilhIClusterScore")
	
	scoreF(indO,list(X=irDat,Y=irC),irC)
	scoreF(indO,list(X=irDat,Y=irC),irCO)
	scoreF(indO,list(X=bx,Y=by),by)
	scoreF(indO,list(X=bx,Y=by),byO)
	scoreF(indO,list(X=mm,Y=mmC),mmC)
	scoreF(indO,list(X=mm,Y=mmC),mmCO)
	
}

test.fakeClusters_NVI <- function(){
	indO <- new("NVIEClusterScore")
	
	scoreF(indO,list(X=irDat,Y=irC),irC)
	scoreF(indO,list(X=irDat,Y=irC),irCO)
	scoreF(indO,list(X=bx,Y=by),by)
	scoreF(indO,list(X=bx,Y=by),byO)
	scoreF(indO,list(X=mm,Y=mmC),mmC)
	scoreF(indO,list(X=mm,Y=mmC),mmCO)
	
}

test.fakeClusters_BCubed <- function(){
	indO <- new("BCEClusterScore")
	
	scoreF(indO,list(X=irDat,Y=irC),irC)
	scoreF(indO,list(X=irDat,Y=irC),irCO)
	scoreF(indO,list(X=bx,Y=by),by)
	scoreF(indO,list(X=bx,Y=by),byO)
	scoreF(indO,list(X=mm,Y=mmC),mmC)
	scoreF(indO,list(X=mm,Y=mmC),mmCO)
	
}

test.fakeClusters_IIndex <- function(){
	indO <- new("IIClusterScore")
	
	scoreF(indO,list(X=irDat,Y=irC),irC)
	scoreF(indO,list(X=irDat,Y=irC),irCO)
	scoreF(indO,list(X=bx,Y=by),by)
	scoreF(indO,list(X=bx,Y=by),byO)
	scoreF(indO,list(X=mm,Y=mmC),mmC)
	scoreF(indO,list(X=mm,Y=mmC),mmCO)
	
}

test.fakeClusters_stdbw <- function(){
	indO <- new("StdbwIClusterScore")
	
	scoreS(indO,list(X=irDat,Y=irC),irC)
	scoreS(indO,list(X=irDat,Y=irC),irCO)
	scoreS(indO,list(X=bx,Y=by),by)
	scoreS(indO,list(X=bx,Y=by),byO)
	scoreS(indO,list(X=mm,Y=mmC),mmC)
	scoreS(indO,list(X=mm,Y=mmC),mmCO)
	
	
}


